using System;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Dao
{
    public class TableWantedTimeLimitDao:DaoBase<TableWantedTimeLimit>
    {
        public override void AddPrimaryIndex(TableWantedTimeLimit model)
        {
            cachePrimary[model.Difficulty.ToString()] = model;
        }

        public override string GetFileName()
        {
            return "TableWantedTimeLimit.txt";
        }

        protected override TableWantedTimeLimit ParseRowData(string[] rowData)
        {
            TableWantedTimeLimit data = new TableWantedTimeLimit();

            if (string.IsNullOrEmpty(rowData[0]))
            {
                data.Difficulty = 0;
            }
            else
            {
                data.Difficulty = int.Parse(rowData[0]);
            }

            if (string.IsNullOrEmpty(rowData[1]))
            {
                data.TimeLimit = 0;
            }
            else
            {
                data.TimeLimit = int.Parse(rowData[1]);
            }
			data.AcceptReward = rowData [2];

            if (string.IsNullOrEmpty(rowData[3]))
            {
                data.Odd = 0;
            }
            else
            {
                data.Odd = int.Parse(rowData[3]);
            }

            return data;
        }



    }

}
